import React, { Component } from 'react'
import { Form, Input, Button } from 'antd';
import '../../../../static/css/client.less'

const layout = {
    labelCol: {
        span: 8,
    },
    wrapperCol: {
        span: 16,
    },
};
/* eslint-disable no-template-curly-in-string */
const validateMessages = {
    required: "${label} is required!",
    types: {
        password: '${label} is not a valid password!',
        number: '${label} is not a valid number!',
    },
    number: {
        range: '${label} must be between ${min} and ${max}',
    },
};
const onFinish = (values) => {
    console.log(values);
};

class ClientEdit extends Component {
    constructor(props) {
        super(props);
        this.state = {}
    }


    render() {
        return (
            <div className="editForm">
                <Form {...layout} name="nest-messages" onFinish={onFinish} validateMessages={validateMessages}>
                    <Form.Item
                        name={['user', 'name']}
                        label="用户昵称"
                    // rules={[
                    //     {
                    //         required: true,
                    //     },
                    // ]}
                    >
                        <Input />
                    </Form.Item>
                    <Form.Item
                        name={['user', 'password']}
                        label="用户密码"
                        rules={[
                            {
                                type: 'password',
                            },
                        ]}
                    >
                        <Input />
                    </Form.Item>
                    {/* <Form.Item name={['user', 'website']} label="Website">
                        <Input />
                    </Form.Item>
                    <Form.Item name={['user', 'introduction']} label="Introduction">
                        <Input.TextArea />
                    </Form.Item> */}
                    <Form.Item wrapperCol={{ ...layout.wrapperCol, offset: 8 }}>
                        <Button type="primary" htmlType="submit">
                            修改用户信息
                        </Button>
                    </Form.Item>
                </Form>

            </div>
        )
    }
}

export default ClientEdit
